<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/top.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css">
<script src="${pageContext.request.contextPath}/static/zTree/jquery.ztree.all-3.5.min.js"></script>
<script src="${pageContext.request.contextPath}/static/myJs/resource.js"></script>
<title>Insert title here</title>
</head>
<body>
<div style="padding-left: 15px;padding-right: 15px;">
	<h3 class="page-header" style="margin-top: 10px;" id="topTitle">菜单管理</h3>
	<div class="container-fluid" style="height: 100%">
	  <div class="row">
	  	<div class="col-md-4">
			<div class="panel panel-default">
			  <div class="panel-heading">资源</div>
			  <div class="panel-body" style="height: 410px;overflow: auto;">
			  	<ul id="resourceTree" class="ztree"></ul>
			  </div>
			</div>
		</div>
  		<div class="col-md-8">
			<div class="panel panel-default">
			  <div class="panel-heading">资源详细信息<span style="color: red;">(菜单不可在此新增)</span> </div>
			  <div class="panel-body"  style="height: 410px;overflow: auto;">
			    <form id="resourceForm" class="form-inline" style="padding-left: 80px;">
			        <input type="hidden" id="opFlag" name="opFlag" value="1" />
			        <input type="hidden" id="resource_id" name="id" />
					<div class="form-group" style="margin-bottom: 5px;padding-right: 20px;">
						<label for="resource_name">资源名称：</label> 
						<input type="text" class="form-control" style="width:150px;" id="resource_name" name="name" data-validation-engine="validate[required]" placeholder="资源名称">
					</div>
					<div class="form-group" style="margin-bottom: 5px;">
						<label for="resource_type">资源类型：</label> 
						<select class="form-control" style="width:150px;" name="type" id="resource_type" data-validation-engine="validate[required]">
							<option value="">---请选择---</option>
							<option value="button">按钮</option>
						</select>
					</div>
					<div class="form-group" style="padding-right: 20px;margin-bottom: 5px;">
						<label for="resource_percode">权限编码：</label> 
						<input type="text" class="form-control" style="width:150px;" id="resource_percode" name="percode" placeholder="权限编码" data-validation-engine="validate[required]">
					</div>
					<div class="form-group" style="">
						<label for="resource_parentid">所属上级：</label> 
						<select class="form-control" style="width:150px;" id="resource_parentid" name="parentid" data-validation-engine="validate[required]">
							<option value="">---请选择---</option>
							<c:if test="${!empty pResource }">
							<c:forEach items="${pResource }" var="re">
							<option value="${re.id }">${re.name }</option>
							</c:forEach>
							</c:if>
						</select>
					</div>
					<div class="form-group" style="padding-right: 20px;margin-bottom: 5px;">
						<label for="resource_available">是否可用：</label> 
						<select class="form-control" style="width:150px;" id="resource_available" name="available" data-validation-engine="validate[required]">
							<option value="">---请选择---</option>
							<option value="1">可用</option>
							<option value="0">不可用</option>
						</select>
					</div>
					<div class="form-group" style="">
						<label for="resource_sort" style="width:70px;">排序号：</label> 
						<input type="text" class="form-control" style="width:150px;" id="resource_sort" name="sort" placeholder="排序号">
					</div>
					<div style="padding-top: 38%;height: 60px;text-align: right;">
						<button type="button" class="btn btn-primary" onclick="formRest();">新建</button>
						<!-- <button type="button" class="btn btn-primary" onclick="menuSave();" id="formSave">保存</button> -->
						<button type="submit" class="btn btn-primary" id="formSave">保存</button>
					</div>
				</form>
			  </div>
			</div>
		</div>
	  </div>
	</div>
	
</div>
</body>
</html>